package com.xhs.controller;

import com.xhs.config.LoginConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @desc:
 * @projectName: maven-package-demo
 * @author: xhs
 * @date: 2023-10-28 028 11:04
 * @version: JDK 1.8
 */
@Slf4j
@RestController
public class LoginController {
    @Resource
    private LoginConfig loginConfig;

    @Value("${jf.system}")
    private String system;

    @GetMapping("/login")
    private Object login() {
        String url = loginConfig.getUrl();
        log.info("<----- url:{} ----->", url);
        String name = loginConfig.getName();
        log.info("<----- name:{} ----->", name);
        log.info("<----- system:{} ----->", system);
        Map<String, Object> hashMap = new HashMap<>(16);
        hashMap.put("url", url);
        hashMap.put("name", name);
        hashMap.put("system", system);
        Map<String, Object> map = new HashMap<>(16);
        map.put("code", 0);
        map.put("msg", "获取成功");
        map.put("data", hashMap);
        return map;
    }
}
